/*
 * Implementation of native methods that access OS thru Win32 API
 */

#include <windows.h>
#include "covertjava_nativecode_OSMemoryInfo.h"

typedef JNIEXPORT jlong (JNICALL* FuncType) (JNIEnv *, jclass);

int main(char** args) 
{
   HMODULE hMod = LoadLibrary("OSMemoryInfo.dll");
   FuncType pFunc = (FuncType)GetProcAddress(hMod, "_Java_covertjava_nativecode_OSMemoryInfo_getPhysicalTotal@8");
   jclass cls;
   int total = -1;


   if (hMod == 0 || pFunc == 0) {
      printf("ERROR: Got hMod = %d, func = %d\n", (int)hMod, (int)pFunc);
      return 1;
   }

   total = pFunc(0, cls);

   printf("Total = %d\n", total);

   return 0;
}


